﻿@model IList<string>
@{
    //ctlName、height、showCheck
    var ctlName = "wardTree";
    var height = "$(window).height() - 25";
    var showCheck = "false";
    if (Model != null && Model.Count > 0)
    {
        ctlName = Model[0];
        if (Model.Count > 1)
        {
            height = Model[1];
        }
        if (Model.Count > 2)
        {
            showCheck = Model[2] == "true" ? "true" : "false";
        }
    }
}
<div id="@(ctlName)"></div>
<script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/wdtree/tree.js")"></script>
<link href="@SiteUrl.GetStaticResourceScriptUrl("~/js/wdtree/tree.css")" rel="stylesheet" />
<script type="text/javascript">
    $(function () {
        $("#@(ctlName)").treeview({
            height: @(height),
            slimscroll: false,
            showcheck: @(showCheck),
            //url: "/SystemManage/BaseData/GetAuthedWardTree",
            url: "/NurseManage/EntryRegistration/TreeViewdata",
            param: {},
            oncheckboxclick: '@(showCheck)' == 'false' ? null : function (item, s) {
                var callbackFuncName = '@(ctlName)' + '_oncheckboxclick';
                if (window[callbackFuncName] && typeof window[callbackFuncName] === 'function') {
                    window[callbackFuncName](item, s);
                }
            },
            onnodeclick: '@(showCheck)' == 'true' ? null : function(item){
                var callbackFuncName = '@(ctlName)' + '_onnodeclick';
                if (window[callbackFuncName] && typeof window[callbackFuncName] === 'function') {
                    window[callbackFuncName](item);
                }
            }

        });
    }
    );
</script>